package com.ruoyi.reviews.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.reviews.mapper.UserReviewsMapper;
import com.ruoyi.reviews.domain.UserReviews;
import com.ruoyi.reviews.service.IUserReviewsService;

/**
 * 用户评价Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-08
 */
@Service
public class UserReviewsServiceImpl implements IUserReviewsService 
{
    @Autowired
    private UserReviewsMapper userReviewsMapper;

    /**
     * 查询用户评价
     * 
     * @param reviewId 用户评价主键
     * @return 用户评价
     */
    @Override
    public UserReviews selectUserReviewsByReviewId(Long reviewId)
    {
        return userReviewsMapper.selectUserReviewsByReviewId(reviewId);
    }

    /**
     * 查询用户评价列表
     * 
     * @param userReviews 用户评价
     * @return 用户评价
     */
    @Override
    public List<UserReviews> selectUserReviewsList(UserReviews userReviews)
    {
        return userReviewsMapper.selectUserReviewsList(userReviews);
    }

    /**
     * 新增用户评价
     * 
     * @param userReviews 用户评价
     * @return 结果
     */
    @Override
    public int insertUserReviews(UserReviews userReviews)
    {
        return userReviewsMapper.insertUserReviews(userReviews);
    }

    /**
     * 修改用户评价
     * 
     * @param userReviews 用户评价
     * @return 结果
     */
    @Override
    public int updateUserReviews(UserReviews userReviews)
    {
        return userReviewsMapper.updateUserReviews(userReviews);
    }

    /**
     * 批量删除用户评价
     * 
     * @param reviewIds 需要删除的用户评价主键
     * @return 结果
     */
    @Override
    public int deleteUserReviewsByReviewIds(Long[] reviewIds)
    {
        return userReviewsMapper.deleteUserReviewsByReviewIds(reviewIds);
    }

    /**
     * 删除用户评价信息
     * 
     * @param reviewId 用户评价主键
     * @return 结果
     */
    @Override
    public int deleteUserReviewsByReviewId(Long reviewId)
    {
        return userReviewsMapper.deleteUserReviewsByReviewId(reviewId);
    }
}
